import readMore from '@/components/readMore'

export default {
  props:{
    //数据
    list:{
      type:Array,
      default:[]
    }
  },
  components:{
    readMore
  },
  data(){
    return {
      shadowStyle: {
        backgroundImage: "none",
        paddingTop: "0",
        marginTop: "20rpx"
      },
      showHeight:120,//150默认高度
    }

  },
  mounted() {
    // if(this.list.length){
    //   this.$nextTick(() => {
    //    setTimeout(()=>{
    //      this.$refs?.uReadMore?.init();
    //      const value = +this.$refs.uReadMore.$el.clientHeight
    //      if(value>600){
    //        this.showHeight = value/2+10
    //      } else {
    //        this.showHeight = value*2
    //      }
    //    },1000)
    //   })
    // }

  },
  methods:{
    onOpens(item,index){
      const arrowName = this.$refs.readMore[index]
      if(arrowName.arrowName==='arrow-down'){
        arrowName.arrowName='arrow-up'
        this. list[index].isToggle=true
      } else {
        arrowName.arrowName='arrow-down'
        this. list[index].isToggle=false
      }
      this.$emit('opes',item.id,index)
    }
  }
}
